<template>
  <!-- 结算页 -->
  <div>
    <div class="item_wrapper">
      <div class="item">
        总数:
        <strong>{{ totalNum }}</strong>
      </div>
      <div class="item">
        总价:
        <strong>{{ totalPrice }}</strong>
      </div>
      <div class="item reset_btn" @click="clearAll">清空购物车</div>
    </div>
  </div>
</template>

<script>
import { mapGetters, mapActions } from "vuex";
export default {
  name: "info",
  data() {
    return {
      // totalNum: 13,
      // totalPrice: 342
    };
  },
  computed: {
    ...mapGetters(["totalPrice", "totalNum"])
  },
  methods: {
    ...mapActions(["clearAll"])
  }
};
</script>

<style lang="scss" scoped>
.item_wrapper {
  display: flex;
  background-color: #dfdfdf;
  align-items: center;
  justify-content: center;
}
.item {
  flex: 1;
}
.reset_btn {
  background-color: brown;
  color: aliceblue;
  cursor: pointer;
}
</style>